package cn.aylog.springboot.service.impl;

import cn.aylog.springboot.entity.Subject;
import cn.aylog.springboot.mapper.SubjectMapper;
import cn.aylog.springboot.service.ISubjectService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 课程科目 服务实现类
 * </p>
 *
 * @author YongTay
 * @since 2022-01-22
 */
@Service
public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> implements ISubjectService {

    @Override
    public List<Subject> queryByPid(String pid) {
        QueryWrapper<Subject> wrapper = new QueryWrapper<>();
        wrapper.eq("parent_id", pid);
        List<Subject> list = list(wrapper);
        return list;
    }
}
